<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
</head>

<body>
  <h1>学生信息</h1>
  <table id="studentTable" border="1">
    <thead>
      <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>年龄</th>
      </tr>
    </thead>
    <tbody>
      <!-- 这里将通过JavaScript动态插入学生信息 -->
    </tbody>
  </table>

  <script>
    // 假设这是从服务器获取的JSON数据
    var studentData = [
      { "学号": "20210001", "姓名": "张三", "年龄": 20 },
      { "学号": "20210002", "姓名": "李四", "年龄": 21 },
      { "学号": "20210003", "姓名": "王五", "年龄": 22 }
    ];

    // 获取表格的tbody元素
    var tbody = document.getElementById('studentTable').getElementsByTagName('tbody')[0];

    // 遍历JSON数据并创建表格行
    studentData.forEach(function (student) {
      var row = tbody.insertRow();
      var cell1 = row.insertCell(0);
      var cell2 = row.insertCell(1);
      var cell3 = row.insertCell(2);
      cell1.innerHTML = student["学号"];
      cell2.innerHTML = student["姓名"];
      cell3.innerHTML = student["年龄"];
    });
  </script>
</body>

</html>